<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .show{
            display: static;
        }
        .hide{
            display: none;
        }
    </style>
</head>
<body>
    <button id="sel" class="show" onclick="allinput()">全选</button>
    <button id="nosel" class="hide" onclick="allinput()">取消全选</button>
    <table id="tab">
        <tr>
          <td>
            <input class="checkbox" type="checkbox">
          </td>
          <td>商品其他信息</td> 
          <td><button onclick="deltr(0)">删除</button></td>
        </tr>
        <tr>
            <td>
                <input class="checkbox" type="checkbox">
            </td>
            <td>商品其他信息</td>
            <td><button onclick="deltr(1)">删除</button></td>
        </tr>
        <tr>
            <td>
                <input class="checkbox" type="checkbox">
            </td>
            <td>商品其他信息</td>
            <td><button onclick="deltr(2)">删除</button></td>
        </tr>
    </table>
</body>
<script>
    function allinput() {
        var ins =document.getElementsByClassName("checkbox");
        for (let i =0; i<ins.length; i++) {
            ins[i].setAttribute("checked","true");
        }
        document.getElementById("sel").setAttribute("class","hide")
        document.getElementById("nosel").setAttribute("class","show")
    }
    function allinput() {
        var ins =document.getElementsByClassName("checkbox");
        for (let i =0; i<ins.length; i++) {
            ins[i].setAttribute("checked","true");
        }
        document.getElementById("sel").setAttribute("class","hide")
        document.getElementById("nosel").setAttribute("class","show")
    }
    function deltr(idx) {
        var tab = document.getElementById("tab")
        console.log(tab.childNodes )
    }
</script>
</html>